﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Extension {
  public static class Enumerable2GenericExt {
    public static IEnumerable<T> Distinct<T, V>(this IEnumerable<T> soource, Func<T, V> keySelector) {
      return soource.Distinct(new CommonEqualityComparer<T, V>(keySelector));
    }
    public static IEnumerable<T> Distinct<T, V>(this IEnumerable<T> source, Func<T, V> keySelector,
      IEqualityComparer<V> comparer) {
      return source.Distinct(new CommonEqualityComparer<T, V>(keySelector, comparer));
    }
  }
}
